package com.hqq.presentation_tier.model_view_controller;

/**
 * Model-View-Controller 模式将应用程序分成三块互相关联的部分：模型、视图、转发器
 * 模型是MVC模式的核心，它描述了领域模型的行为,独立于用户接口，直接管理数据和逻辑
 * 视图是信息的展示，包括表格和图标
 * 转发器负责接收输入并且转发到相应的视图
 * Created by heqianqian on 2017/8/17.
 */
public class App {

    public static void main(String[] args) {
        //init
        GiantModel model = new GiantModel(Fatigue.ALERT,Health.HEALTHY,Nourishment.SATURATED);
        GiantView view = new GiantView();
        GiantController controller = new GiantController(model,view);
        //display
        controller.updateView();

        //update model
        controller.setFatigue(Fatigue.TIRED);
        controller.setHealth(Health.DEAD);
        controller.setNourishment(Nourishment.HUNGRY);
        //redisplay
        controller.updateView();
    }
}
